package Born.utils.Date
{
	public class ConfigureHour
	{
		private static var $hourString			:String;
		private static var $hourSimple			:uint;
		private static var $hour				:String;
		private static var $minute				:String;
		private static var $second				:String;
		/**
		 * Receive video or music time (uint) and<br />
		 * will retun the String of the Hour<br />
		 * Return Format: <b>mm:ss</b> or <b>hh:mm:ss</b>
		 * @param _hour :uint
		 * @return :String
		 */		
		public static function simpleHour(_hour:uint):String
		{
			$hourSimple = _hour;
			if ( $hourSimple < 60 )
			{
				if ( $hourSimple < 10 ) $hourString = "00:0" + $hourSimple;
				else $hourString = "00:" + $hourSimple;
			}
			else if ( $hourSimple >= 60 && $hourSimple < 3600 )
			{
				$minute = String(int($hourSimple/60));
				$second = String(int($hourSimple%60));
				
				if ( uint($minute) < 10 ) $minute = String("0" + $minute);
				if ( uint($second) < 10 ) $second = String("0" + $second);
				
				$hourString = $minute + ":" + $second;
			}
			else
			{
				$hour 	= String(int($hourSimple/3600));
				$minute = String(int(int($hourSimple%3600)/60));
				$second = String(int(int($hourSimple%3600)) - (uint($minute) * 60));
				
				if ( uint($hour) < 10 ) $hour = String("0" + $hour);
				if ( uint($minute) < 10 ) $minute = String("0" + $minute);
				if ( uint($second) < 10 ) $second = String("0" + $second);
				
				$hourString = $hour + ":" + $minute + ":" + $second;
			}
			return $hourString;
		}
	}
}